home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Washington_1988 / DevCon88.3 / Printer / src / HP / density.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  1.1 KB  |  39 lines

  1. /*
  2.     Density module for HP_LaserJet
  3.     David Berezowski - May/87
  4.  
  5.   Copyright (c) 1988 Commodore-Amiga, Inc.
  6.  
  7.   Executables based on this information may be used in software
  8.   for Commodore Amiga computers.  All other rights reserved.
  9.  
  10.   This information is provided "as is"; no warranties are made.
  11.   All use is at your own risk, and no liability or responsibility is assumed.
  12. */
  13.  
  14.  
  15. #include <exec/types.h>
  16. #include "../printer/printer.h"
  17. #include "../printer/prtbase.h"
  18.  
  19. SetDensity(density_code)
  20. ULONG density_code;
  21. {
  22.     extern struct PrinterExtendedData *PED;
  23.     extern char StartCmd[];
  24.  
  25.     /* SPECIAL_DENSITY     0   1   2    3    4    5    6    7 */
  26.     static int XDPI[8] = {75, 75, 100, 150, 300, 300, 300, 300};
  27.     static char codes[8][3] = {
  28.         "075", "075", "100", "150", "300", "300", "300", "300"
  29.     };
  30.  
  31.     density_code /= SPECIAL_DENSITY1;
  32.     PED->ped_MaxXDots = XDPI[density_code] * 8; /* 8 inches */
  33.     PED->ped_MaxYDots = XDPI[density_code] * 10; /* 10 inches */
  34.     PED->ped_XDotsInch = PED->ped_YDotsInch = XDPI[density_code];
  35.     StartCmd[8] = codes[density_code][0];
  36.     StartCmd[9] = codes[density_code][1];
  37.     StartCmd[10] = codes[density_code][2];
  38. }
  39.